package com.bite.springmvc.controller;

import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/hello/v1")
public class HelloController {
    //全部请求都支持
    @RequestMapping("/hello/v2")
    public String hello(){
        return "hello spring mvc";
    }
    //仅支持post请求
    //method = RequestMethod.POST
    @RequestMapping(value = "/hello2",method = RequestMethod.POST)
    public String hello2(){
        return "hello2 spring mvc";
    }

    @GetMapping("/hello3")
    public String hello3(){
        return "hello3 springmvc  3";
    }

    @PostMapping("/hello4")
    public String hello4(){
        return "hello4 springmvc   4";
    }
}
